<template>
  <div class="app-container">
    <el-form ref="queryForm" :inline="true" :model="queryForm">
      <el-form-item label="会员ID" prop="id">
        <el-input
          v-model="queryForm.id"
          size="small"
          placeholder="请输入会员ID"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="会员姓名" prop="userRealName">
        <el-input
          v-model="queryForm.userRealName"
          size="small"
          placeholder="请输入会员姓名"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      
      <el-form-item label="手机号" prop="mobile">
        <el-input
          v-model="queryForm.mobile"
          size="big"
          placeholder="请输入会员手机号"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item><el-form-item label="工薪云" prop="status">
        <el-select
          v-model="queryForm.icbcOpen"
          placeholder="工薪云状态"
          clearable
          size="small"
          style="width: 120px"
        >
          <el-option
            v-for="dict in openOptions"
            :key="dict.value"
            :label="dict.name"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select
          v-model="queryForm.status"
          placeholder="会员状态"
          clearable
          size="small"
          style="width: 120px"
        >
          <el-option
            v-for="dict in statusOptions"
            :key="dict.value"
            :label="dict.name"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      
      <!-- <el-form-item label="创建时间">
        <el-date-picker
          v-model="dateRange"
          size="small"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
        >搜索</el-button>
        <!-- <el-button
          icon="el-icon-download"
          size="mini"
          @click="handleDownLoadUser"
        >下载会员数据</el-button> -->
        <el-button
          icon="el-icon-refresh"
          size="mini"
          @click="resetQuery"
        >重置</el-button>
        <div class="tixian">
          <span>当前未提现总额：</span>
          <span style="color: #ef3939;">￥{{ shenqing }}</span>
        </div>
        <div class="tixian">
          <span>未兑换积分总额：</span>
          <span style="color: #ef3939;">￥{{ elses }}</span>
        </div>
        <div class="tixian">
          <span>总推荐收益：</span>
          <span style="color: #ef3939;">￥{{ AlluserRecommendCash }}</span>
        </div>
      </el-form-item>
    </el-form>

    <el-form ref="queryListForm" :inline="true" :model="queryListForm">
      <el-form-item label="推荐人手机号" prop="mobile">
        <el-input
          v-model="queryListForm.mobile"
          size="big"
          placeholder="请输入推荐人手机号"
          @keyup.enter.native="handleQueryList"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQueryList"
        >搜索</el-button>
        <el-button
          icon="el-icon-download"
          size="mini"
          @click="handleDownLoad"
        >下载分仓数据</el-button>
      </el-form-item>
    </el-form>
    <!-- <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd()">新增</el-button>
      </el-col>
    </el-row> -->

    <el-table v-loading="loading" border :data="memberList" style="width: 100%;">
      <el-table-column label="会员Id" prop="id" width="60" />
      <!-- <el-table-column label="性别" prop="gender">
        <template slot-scope="scope">
          {{ scope.row.gender == 1 ? "男" : "女" }}
        </template>
      </el-table-column> -->
      <el-table-column label="真实姓名" prop="userRealName" width="80" />
      <el-table-column label="手机号" prop="mobile" width="120" />
      <el-table-column label="邀请码" prop="inviteCode" width="110" />
      <el-table-column label="手写签名" prop="sign" width="150">
        <template slot-scope="scope">
          <img v-if="scope.row.sign" :src="scope.row.sign" width="80">
        </template>
      </el-table-column>
      <!-- <el-table-column label="推荐人ID" prop="invitePeopleId" /> -->
      <el-table-column label="推荐人" prop="invitePeopleName" width="80" />
      <el-table-column label="推荐人手机号" prop="invitePeopleMobile" width="120"/>
      <el-table-column label="是否开通工薪云" prop="icbcOpen" width="130">
        <template slot-scope="scope">
          <el-tag
            disable-transitions
          >{{ scope.row.icbcOpen == 0? '已开通':'未开通' }}</el-tag>
        </template>
      </el-table-column>

      <el-table-column label="当前余额" prop="zyeBalance" width="120" />
      <el-table-column label="可提现余额" prop="ktxBalance" width="120" />
      <el-table-column label="可抵扣余额" prop="kdkBalance" width="120" />

      <el-table-column label="采购奖励" prop="userCash" width="120" />
      <el-table-column label="推荐收益" prop="userRecommendCash" width="120" />
      <el-table-column label="当前积分" prop="userPoint" width="100"/>
      <el-table-column label="会员级别" prop="userLevel" width="100">
        <template slot-scope="scope">
          <el-tag
            disable-transitions
          >{{ scope.row.userLevel == 0? '普通会员':scope.row.userLevel == 1?'黄金会员':scope.row.userLevel == 2?'股东会员':'总裁会员' }}</el-tag>
        </template>
      </el-table-column>
      <!-- <el-table-column label="头像" prop="avatar" width="200">
        <template slot-scope="scope">
          <img v-if="scope.row.avatar" :src="scope.row.avatar" width="80">
        </template>
      </el-table-column> -->
      <!-- <el-table-column label="最后登陆Ip" prop="lastLoginIp" /> -->
      <el-table-column label="创建时间" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="最后登陆时间" prop="lastLoginTime" width="160">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastLoginTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" width="60" :formatter="statusFormat" />
      
      <!-- <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <el-tag>{{ scope.row.status ==0? '正常':'冻结' }}</el-tag>
        </template>
      </el-table-column> -->
      <el-table-column
        label="操作"
        fixed="right"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            v-hasPermi="['system:mebmer:update']"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
          >编辑</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleReset(scope.row)"
          >重置密码</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleResetSign(scope.row)"
          >重置签名</el-button>
          <el-button
            v-hasPermi="['system:mebmer:update']"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdateBalance(scope.row)"
          >充值余额</el-button>
          <el-button
            v-hasPermi="['system:mebmer:update']"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdateopenIntegral(scope.row)"
          >充值积分</el-button>
          <el-button
          icon="el-icon-download"
          size="mini"
          type="text"
          @click="handleDownLoadUser(scope.row)"
        >下载会员数据</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total"
      :total="total"
      :page.sync="queryForm.pageNum"
      :limit.sync="queryForm.pageSize"
      @pagination="getList"
    />

    <!-- 用户编辑对话框 -->
    <el-dialog
      :visible.sync="open"
      title="用户编辑"
      width="600px"
      :close-on-click-modal="false"
      :before-close="memberDialogHandleClose"
    >
      <el-form
        ref="userDetail"
        :model="userDetail"
        :rules="rules"
        label-width="100px"
      >
        <el-form-item label="用户昵称" prop="nickname">
          <el-input v-model="userDetail.nickname" />
        </el-form-item>
        <el-form-item label="用户姓名" prop="userRealName">
          <el-input v-model="userDetail.userRealName" />
        </el-form-item>
        <el-form-item label="用户手机" prop="mobile">
          <el-input v-model="userDetail.mobile" />
        </el-form-item>
        <!-- <el-form-item label="邀请人ID" prop="invitePeopleId">
          <el-input v-model="userDetail.invitePeopleId" />
        </el-form-item> -->
        <el-form-item label="邀请人ID">
          <el-select v-model="userDetail.invitePeopleId" clearable filterable placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.mobile"
              :label="item.mobile + '-' + item.userRealName"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        
        <el-form-item label="会员等级">
          <el-select v-model="userDetail.userLevel" placeholder="会员等级">
            <el-option v-for="(item) in userLevelList" :key="item.value" :label="item.label" :value="item.value" />
            <!-- <el-option :key="普通会员" label="普通会员" value="0" />
            <el-option :key="黄金会员" label="黄金会员" value="1" />
            <el-option :key="股东会员" label="股东会员" value="2" />
            <el-option :key="总裁会员" label="总裁会员" value="3" /> -->
          </el-select>
        </el-form-item>
        <el-form-item label="用户性别" prop="gender">
          <el-radio-group v-model="userDetail.gender">
            <el-radio :label="0">男</el-radio>
            <el-radio :label="1">女</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="工薪云" prop="icbcOpen">
          <el-radio-group v-model="userDetail.icbcOpen">
            <el-radio :label="0">开通</el-radio>
            <el-radio :label="1">未开通</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="开通特权" prop="cgOrderStartEarly">
          <el-radio-group v-model="userDetail.cgOrderStartEarly">
            <el-radio :label="0">否</el-radio>
            <el-radio :label="1">是</el-radio>
          </el-radio-group>
        </el-form-item>
        
        <div v-if="userDetail.cgOrderStartEarly==1">
          <el-form-item label="特权截止日期" prop="cgOrderStartEarlyDay">
            <!-- <el-input type="number" min="1" v-model="userDetail.cgOrderStartEarlyDay" /> -->
            <el-date-picker
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              v-model="userDetail.cgOrderStartEarlyDay"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </div>
        <el-form-item label="状态" prop="status">
          <el-radio-group v-model="userDetail.status">
            <el-radio
              v-for="dict in statusOptions"
              :key="dict.value"
              :label="parseInt(dict.value)"
            >{{ dict.name }}</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确定</el-button>
        <el-button @click="memberDialogHandleClose">取消</el-button>
      </div>
    </el-dialog>

    <!-- 充值余额 -->
    <el-dialog
      :visible.sync="openBalance"
      title="充值余额"
      width="450px"
      :close-on-click-modal="false"
      :before-close="handleDialogCloseBalance"
    >
      <el-form label-width="80px">
        <el-form-item label="充值" prop="balance">
          <el-input-number
            v-model="balance"
            :min="1"
            label="金额"
          />
          <el-button
            type="primary"
            style="margin-left: 30px"
            @click="submitFormBalance('add')"
          >确定</el-button>
        </el-form-item>
        <el-form-item label="扣除" prop="reduceBalance">
          <el-input-number
            v-model="reduceBalance"
            :min="1"
            label="金额"
          />
          <el-button
            type="primary"
            style="margin-left: 30px"
            @click="submitFormBalance('reduce')"
          >确定</el-button>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleDialogCloseBalance">取消</el-button>
      </div>
    </el-dialog>

    <!-- 充值积分 -->
    <el-dialog
      :visible.sync="openIntegral"
      title="充值积分"
      width="450px"
      :close-on-click-modal="false"
      :before-close="handleDialogCloseIntegral"
    >
      <el-form label-width="80px">
        <el-form-item label="当前积分" prop="userPoint">
          <el-input v-model="userDetail.userPoint" disabled />
        </el-form-item>
        <el-form-item label="充值" prop="balance">
          <el-input-number
            v-model="balance"
            :min="1"
            label="积分"
          />
          <el-button
            type="primary"
            style="margin-left: 30px"
            @click="rechargePointsDeductPoints('add')"
          >确定</el-button>
        </el-form-item>
        <el-form-item label="扣除" prop="reduceBalance">
          <el-input-number
            v-model="reduceBalance"
            :min="1"
            label="积分"
          />
          <el-button
            type="primary"
            style="margin-left: 30px"
            @click="rechargePointsDeductPoints('reduce')"
          >确定</el-button>
          </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button
          type="primary"
          style="margin-left: 30px"
          @click="() => submitFormIntegral('add')"
        >确定</el-button> -->
        <el-button @click="handleDialogCloseIntegral">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listMember, getMember, updateMember, addBalance,getAllMemeberByPhone,exporAllMemeberByPhone,pcRechargePointsDeductPoints,getSumAllUserKtxAndpoints, exporadminRechargeRecordsByUserIdList,resetPassword,pcUserIdResettingSign } from '@/api/shop/user/member'
import { listUser } from '@/api/shop/order'
import { getToken } from '@/utils/auth'
import { uploadPath } from '@/api/upload'
import {excelNameDate} from  '@/utils/index'


export default {
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 添加/修改对话框 title
      title: '',
      shenqing:0,
      elses:0,
      AlluserRecommendCash:0,
      // 列表总数
      total: 0,
      // 日期范围
      dateRange: [],
      // 查询参数
      queryForm: {
        pageNum: 1,
        pageSize: 50,
        id: undefined,
        userRealName: undefined,
        status: '0',
        mobile:undefined
      },
      queryListForm: {
        mobile: undefined
      },
      // 角色列表
      memberList: [],
      // 是否显示弹出层
      open: false,
      // 用户编辑表单
      userDetail: {
        cgOrderStartEarlyDay: undefined
      },
      // 表单校验
      rules: {
        userRealName: [
          { required: true, message: '昵称不能为空', trigger: 'blur' }
        ],
        mobile: [
          { required: true, message: '手机号不能为空', trigger: 'blur' }
        ]
      },
      // 状态数据字典
      statusOptions: [],
      openOptions:[
        {
          name:'开通',
          value:0
        },
        {
          name:'未开通',
          value:1
        }
      ],
      // 上传文件路径
      uploadPath,
      // 上传路径header设置
      headers: { Authorization: 'Bearer ' + getToken() },
      options:[],
      // 充值余额
      balance: 1,
      openIntegral: false,
      integral: 0,
      openBalance: false,
      reduceBalance: 1,
      userLevelList: [
        {
          label: '普通会员',
          value: 0
        },
        {
          label: '黄金会员',
          value: 1
        },
        {
          label: '股东会员',
          value: 2
        },
        {
          label: '总裁会员',
          value: 3
        }
      ]
    }
  },
  created() {
    
    this.getDicts('status').then((response) => {
      const {
        map: { data }
      } = response
      console.log(data)
      this.statusOptions = data
    })
    this.getList()
    this.getSumAllUser()
  },
  methods: {
    handleResetSign(row){
      this.$confirm(
        `是否将编号为${row.id}的签名重置为空`,
        '提示',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }
      ).then(res=>{
        pcUserIdResettingSign({userId:row.id}).then(ress=>{
          if(ress.code == 200){
            // this.userId = undefined
            this.$message.success('重置成功')
            this.getList()
          }
        })
      })
    },
    handleReset(row){
      this.$confirm(
        `是否将编号为${row.id}的密码重置为123456`,
        '提示',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }
      ).then(res=>{
        resetPassword({userId:row.id}).then(ress=>{
          if(ress.code == 200){
            // this.userId = undefined
            this.$message.success('重置成功')
          }
        })
      })
    },

    // 获取可提现总额
    async getSumAllUser(){
      const res =await getSumAllUserKtxAndpoints()
      if(res.code ==200){
        this.shenqing = res.map.ktxPrice
        this.elses = res.map.pointPrice
        this.AlluserRecommendCash = res.map.AlluserRecommendCash
      }
    },

    handleDownLoadUser(row) {
      // if(this.queryForm.id == undefined || this.queryForm.id == '' || this.queryForm.id == null){
      //   return this.$message.error('需先输入用户ID')
      // }
      this.$confirm(
        '是否下载会员数据',
        '提示',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }
      )
        .then(res => {
          exporadminRechargeRecordsByUserIdList({userId:row.id}).then(res => {
            const blob = new Blob([res.data], { type: 'application/msword' })// new Blob([res])中不加data就会返回下图中[objece objece]内容（少取一层）
            console.log(blob)
            const dates = excelNameDate()
            const fileName = `编号${row.id}会员数据${dates}.xls`// 下载文件名称
            const elink = document.createElement('a')
            elink.download = fileName
            elink.style.display = 'none'
            elink.href = URL.createObjectURL(blob)
            document.body.appendChild(elink)
            elink.click()
            URL.revokeObjectURL(elink.href) // 释放URL 对象
          })
          // this.loadingDown = true
          console.log(res)
        })
    },
    /**
     * 充值积分
     */
     async rechargePointsDeductPoints(type) {
      const data = {
        rechargeAmountType: 1,
        rechargeAmount: this.balance,
        id: this.userDetail.id
      }
      // this.openBalance = false

      if (type === 'reduce') {
        data.rechargeAmountType = 2
        data.rechargeAmount = this.reduceBalance
      }
      console.log(data)
      const res = await pcRechargePointsDeductPoints(data)
      console.log(res)
      if (res.code == 200) {
        this.$message.success('充值成功')
      }
      this.openIntegral = false
      this.reduceBalance = 1
      this.balance = 1
      this.getList()
      this.getSumAllUser()
      this.userDetail = {}
    },
    async handleDelete(row){
      if(row.status !=1){
        return this.$message.error('当前用户非禁用状态，无法删除！')
      }
      const res =await updateMember({id:row.id,delFlag:1})
      console.log(res)
      // if(res.)
    },

    /**
     * 充值余额
     */
    async submitFormBalance(type) {
      const data = {
        rechargeAmountType: 1,
        rechargeAmount: this.balance,
        id: this.userDetail.id
      }
      this.openBalance = false
      if (type === 'reduce') {
        data.rechargeAmountType = 2
        data.rechargeAmount = this.reduceBalance
      }
      console.log(data)
      const res = await addBalance(data)
      console.log(res)
      if (res.code == 200) {
        this.$message.success('充值成功')
      }
      this.getList()
      this.getSumAllUser()
      
      this.reduceBalance = 1
      this.balance = 1
      this.userDetail = {}
    },
    handleDialogCloseBalance() {
      this.openBalance = false
    },
    submitFormIntegral() {
      this.integral++
    },
    handleUpdateBalance(row) {
      console.log('row====',row)
      this.userDetail = row
      this.openBalance = true
    },
    handleDialogCloseIntegral() {
      this.integral = 0
      this.userDetail = {}
      this.openIntegral = false
    },
    async handleUpdateopenIntegral(row) {
      const {
        map: { data }
      } = await getMember(row.id)
      this.userDetail = data
      console.log('this.userDetail:', this.userDetail)
      this.openIntegral = true
    },
    handleQuery() {
      this.getList()
    },
    /**
     * 表单重置
     */
    resetQuery() {
      this.$refs.queryForm.resetFields()
      this.dateRange = []
      this.handleQuery()
    },
    async getList() {
      const {
        map: {
          page: { records: data, total }
        }
      } = await listMember(this.addDateRange(this.queryForm, this.dateRange))
      this.total = total
      this.memberList = data
      this.loading = false
    },
    /**
     * switch 状态发生变化时的回调函数
     */
    handleSwitchChange(row) {
      const text = row.status === 0 ? '启用' : '停用'
      this.$confirm('确认要 "' + text + '"该会员吗?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(function() {
          return new Promise()
        })
        .then(() => {
          this.$message.success(text + '成功')
        })
        .catch(function() {
          row.status = row.status === 0 ? 1 : 0
        })
    },
    // 字典状态字典翻译
    statusFormat(row, column) {
      return this.echoDictName(this.statusOptions, row.status)
    },
    /**
     * 会员对话框关闭
     */
    memberDialogHandleClose() {
      this.reset()
      this.open = false
    },
    /**
     * 表单重置
     */
    reset() {
      this.userDetail = {}
      this.$refs['userDetail'].resetFields()
    },
    /**
     * 编辑操作
     */
    async handleUpdate(row) {
      this.options = []
      
      const {
        map: { data }
      } = await getMember(row.id)
      if(data.cgOrderStartEarlyDay == 0){
        data.cgOrderStartEarlyDay =new Date()
      }
      this.userDetail = data
      console.log('this.userDetail:', this.userDetail)
      await this.getOptions(row.id)
      this.open = true
    },
    async getOptions(id) {
      const res = await listUser()
      let userList =res.map.userList
      userList.forEach((item,index)=>{
        if(id == item.id){
          userList.splice(index,1)
        }
      })
      this.options = userList
    },
    /**
     * 提交会员表单
     */
    submitForm() {
      if(this.userDetail.cgOrderStartEarlyDay<=0 && this.userDetail.cgOrderStartEarly!=0){
        return this.$message.error('特权天数最低为1')
      }
      this.$refs['userDetail'].validate((valid) => {
        if (valid) {
          if (this.userDetail.id !== undefined) {
            if(this.userDetail.id ==96 && this.userDetail.invitePeopleId){
              return this.$message.error('店长不能指定邀请人')
            }
            delete this.userDetail.jyzBalance
            delete this.userDetail.kdkBalance
            delete this.userDetail.ktxBalance
            delete this.userDetail.userCash
            delete this.userDetail.userPoint
            delete this.userDetail.zyeBalance
            delete this.userDetail.userRecommendCash
            delete this.userDetail.userBalance

            // this.userDetail.cgOrderStartEarlyDay= this.userDetail.cgOrderStartEarlyDay.format()
            updateMember(this.userDetail).then((response) => {
              this.updateHandle(response, this)
            })
          }
        }
      })
    },
    //下载分仓数据
    handleDownLoad() {
      if(this.queryListForm.mobile == '' || this.queryListForm.mobile == undefined){
        return this.$message.error('请输入分仓人手机号')
      }
      this.$confirm(
        '是否下载分仓数据',
        '提示',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }
      )
        .then(res => {
          exporAllMemeberByPhone({phoneNumber:this.queryListForm.mobile}).then(res => {
            const blob = new Blob([res.data], { type: 'application/msword' })// new Blob([res])中不加data就会返回下图中[objece objece]内容（少取一层）
            console.log(blob)

            const dates = excelNameDate()
            const fileName = `分仓数据${dates}-${this.queryListForm.mobile}.xls`// 下载文件名称
            const elink = document.createElement('a')
            elink.download = fileName
            elink.style.display = 'none'
            elink.href = URL.createObjectURL(blob)
            document.body.appendChild(elink)
            elink.click()
            URL.revokeObjectURL(elink.href) // 释放URL 对象
          })
          // this.loadingDown = true
          console.log(res)
        })
    },
    // 根据手机号搜索分仓数据
    async handleQueryList(){
      if(this.queryListForm.mobile == '' || this.queryListForm.mobile == undefined){
        return this.$message.error('请输入分仓人手机号')
      }
      const res = await getAllMemeberByPhone({phoneNumber:this.queryListForm.mobile})
      this.memberList = res.map.members
      this.$set(this.queryForm,'pageSize',50)
      console.log(res)
    }
  }
}
</script>
<style lang="scss" scoped>
.tixian{
        display: inline-block;
        margin-left: 50px;
      }
</style>
